package com.qqtech.qquan.community.model;

import java.math.BigDecimal;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;

@SuppressWarnings("serial")
public class CommunityBaseVo extends CommunityBase {
	private boolean txtShow;
	
	/**
	 * 是否是加入的社区
	 */
	private boolean isJoin;

	/**
	 * 创建人名称
	 */
	private String creatorNick;

	/**
	 * 城市名称
	 */
	private String cityName;

	/**
	 * 区名称
	 */
	private String districtName;

	/**
	 * 距离
	 */
	private BigDecimal distance;// 距离

	public String getCityName() {
		return cityName;
	}

	public String getCreatorNick() {
		return creatorNick;
	}

	public BigDecimal getDistance() {
		return distance;
	}

	public String getDistrictName() {
		return districtName;
	}

	public Integer getIntDistance() {
		if (null != distance) {
			return distance.intValue();
		}
		return 0;
	}

	public boolean getIsJoin() {
		return isJoin;
	}

	/** 是否显示图片 **/
	public boolean getIsShowImg() {
		if (StringUtils.isNotBlank(this.getImg())) {
			return true;
		} else {
			return false;
		}
	}

	public String getPathImgs() {
		if (StringUtil.isBlank(this.getImg())) {
			return "";
		}
		String filePath = ";" + this.getFileDomain();
		String pathImgs = this.getImg().replaceAll(";", filePath);
		return this.getFileDomain() + pathImgs;
	}

	public boolean isTxtShow() {
		return txtShow;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public void setCreatorNick(String creatorNick) {
		this.creatorNick = creatorNick;
	}

	public void setDistance(BigDecimal distance) {
		this.distance = distance;
	}

	public void setDistrictName(String districtName) {
		this.districtName = districtName;
	}

	public void setIsJoin(boolean isJoin) {
		this.isJoin = isJoin;
	}

	public void setTxtShow(boolean txtShow) {
		this.txtShow = txtShow;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

}